package com.varian.auth.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.varian.auth.model.dto.OAuth2AuthorizationInfoPageDTO;
import com.varian.auth.model.vo.OAuth2AuthorizationInfoItemVO;
import com.varian.auth.service.IOAuth2AuthorizationInfoService;
import com.varian.service.web.BaseController;
import com.varian.tool.result.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.security.PermitAll;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ben
 * @since 2024/6/30
 */
@PermitAll
@RestController
@RequiredArgsConstructor
@Tag(name = "OAuth2授权信息控制层")
@RequestMapping("/oauth2/authorization-info")
public class OAuth2AuthorizationController extends BaseController<IOAuth2AuthorizationInfoService> {

    @GetMapping("page")
    @Operation(summary = "分页查询OAuth2授权信息")
    public R<Page<OAuth2AuthorizationInfoItemVO>> page(@Validated OAuth2AuthorizationInfoPageDTO dto){
        return R.data(baseService.page(dto));
    }

}
